"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.downloadLocal = null;

var _downloadGitRepo = require("download-git-repo");

var _downloadGitRepo2 = _interopRequireDefault(_downloadGitRepo);

function _interopRequireDefault(obj) {
  return obj && obj.__esModule ? obj : { default: obj };
}

exports.downloadLocal = async (templateName, projectName) => {
  // https://gitee.com/daiyehao/RN_0.57.8.git
  let api = `direct:https://gitee.com/daiyehao/${templateName}.git`;
  // console.log(api);
  return new Promise((resolve, reject) => {
    (0, _downloadGitRepo2.default)(api, projectName, { clone: true }, err => {
      if (err) {
        reject(err);
      }
      resolve();
    });
  });
};
